﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;

namespace Young3.FMSearch.Core.Entities.InGame
{
    public static partial class PositionalRatings
    {
        private static Func<PlayerSkills, decimal> __fbRatings = null;
        public static Func<PlayerSkills, decimal> FBRatings
        {
            get
            {
                if (__fbRatings == null)
                {
                    __fbRatings = (p) =>
                        (Convert.ToDecimal(
                        p.Crossing*40+
                        p.Dribbling*20+
                        p.FirstTouch*10+
                        p.Heading*40+
                        p.Marking*60+
                        p.Passing*20+
                        p.Tackling*100+
                        p.Technique*20+

                        p.Aggression*20+
                        p.Anticipation*80+
                        p.Bravery*40+
                        p.Composure*20+
                        p.Concentration*40+
                        p.Creativity*20+
                        p.Decisions*40+
                        p.Influence*10+
                        p.Positioning*100+
                        p.Teamwork*20+
                        p.Workrate*20+

                        p.Acceleration*70+
                        p.Agility*30+
                        p.Balance*20+
                        p.Jumping*60+
                        p.Pace*70+
                        p.Stamina*60+
                        p.Strength*60
                        )
                        / Convert.ToDecimal((40+20+10+40+60+20+100+20+20+80+40+20+40+20+40+10+100+20+20
                        +70+30+20+60+70+60+60) * 100));
                }
                return __fbRatings;
            }
        }
    }
}
